package com.stylefeng.guns.modular.system.model;

import java.io.Serializable;

import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author stylefeng123
 * @since 2018-07-27
 */
@TableName("rmb_cash_receipts")
public class RmbCashReceipts extends Model<RmbCashReceipts> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 摘要
     */
    private int summary;
    /**
     * 应收应付往来客户
     */
    private String customer;
    /**
     * 收款金额
     */
    private Double amount;
    /**
     * 订单号
     */
    @TableField("order_number")
    private String orderNumber;
    /**
     * 支出金额 1-收款、2-支出
     */
    private Integer type;
    /**
     * 日期
     */
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date revdate;
    /**
     * 平台名称
     */
    private String platform;
    private String note;//备注
    /**
     * 创建时间
     */
    private Date creattime;
    /**
     * 更新时间
     */
    private Date updatetime;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getSummary() {
        return summary;
    }

    public void setSummary(int summary) {
        this.summary = summary;
    }

    public String getCustomer() {
        return customer;
    }

    public void setCustomer(String customer) {
        this.customer = customer;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Date getRevdate() {
        return revdate;
    }

    public void setRevdate(Date revdate) {
        this.revdate = revdate;
    }

    public Date getCreattime() {
        return creattime;
    }

    public void setCreattime(Date creattime) {
        this.creattime = creattime;
    }

    public Date getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }

    public String getPlatform() {
        return platform;
    }

    public void setPlatform(String platform) {
        this.platform = platform;
    }

    public String getOrderNumber() {
        return orderNumber;
    }

    public void setOrderNumber(String orderNumber) {
        this.orderNumber = orderNumber;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "RmbCashReceipts{" +
        "id=" + id +
        ", summary=" + summary +
        ", customer=" + customer +
        ", mount=" + amount +
        ", type=" + type +
        ", platform=" + platform +
        ", note=" + note +
        ", revdate=" + revdate +
        ", creattime=" + creattime +
        ", updatetime=" + updatetime +
        "}";
    }

    public static enum Enum_Summary {
        //1:披索,2:人民币
        应收(16, "应收"), 应付(17, "应付"), 手续费(21, "手续费");
        public Integer value;
        public String desc;

        private Enum_Summary(Integer _Value, String _Desc) {
            this.value = _Value;
            this.desc = _Desc;
        }

    }

    public static enum Enum_Type {
        //1:披索,2:人民币
        收款(1, "收款"), 支出(2, "支出");
        public Integer value;
        public String desc;

        private Enum_Type(Integer _Value, String _Desc) {
            this.value = _Value;
            this.desc = _Desc;
        }

    }

    public static String getDesc(Integer value){
        Enum_Summary[] summarys = Enum_Summary.values();
        for (int i = 0;i< summarys.length;i++){
            if (value ==summarys[i].value )
                return summarys[i].desc;
        }
        return null;
    }


    public static enum Enum_DetailType {
        生活成本费用(1, "生活成本费用"), 市场推广(2, "市场推广"),借贷(3, "借贷"),手续费(4, "手续费"),其他费用(5,"其他费用"),市场费用(6,"市场费用");
        public Integer value;
        public String desc;

        private Enum_DetailType(Integer _Value, String _Desc) {
            this.value = _Value;
            this.desc = _Desc;
        }
    }
}
